<?php
session_start();
$featured   =   $_POST['featured'];
$news_title =   $_POST['news_title'];
$caption    =   $_POST['caption'];
$content    =   $_POST['content'];
$posted_by  =   $_SESSION['name'];
$day        =   $_POST['day'];
$cat_id     =   $_POST['category'];
$location   =   $_POST['location'];
$posted_on  =   date("d-m-Y  H:i");


include "db_connect.php";

$news_add = "INSERT INTO `news` (`id` ,`featured_status` ,`news_title`, `caption`,`content` ,`posted_by` ,`posted_on` ,`rating` ,`category_id`, `location`)
VALUES (NULL, '$featured' , '$news_title' , '$caption' , '$content',  '$posted_by',  '$posted_on',  NULL ,  '$cat_id', '$location')";

if (mysql_query($news_add))
        header ("location:../admin.php");
    else {
        mysql_error();
        die("News Update Failed");
         }

?>
